﻿<UserControl x:Class="MARC.EHRS.Silverlight.PopperMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <Storyboard x:Name="sbClick">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(RepeatButton.RenderTransform).(RenderTransform.TranslateY)">
                <LinearDoubleKeyFrame KeyTime="0:00:0.2" Value="-10"/>
                <LinearDoubleKeyFrame KeyTime="0:00:0.3" Value="0"/>
                <LinearDoubleKeyFrame KeyTime="0:00:0.5" Value="-5"/>
                <LinearDoubleKeyFrame KeyTime="0:00:0.6" Value="0"/>
                <LinearDoubleKeyFrame KeyTime="0:00:0.8" Value="-2"/>
                <LinearDoubleKeyFrame KeyTime="0:00:0.9" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Key="MenuButtonStyle" TargetType="ButtonBase">
                <Style.Setters>
                    <Setter Property="Padding" Value="10,0"/>
                    <Setter Property="Width" Value="32"/>
                    <Setter Property="Height" Value="32"/>
                    <Setter Property="Margin" Value="12"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ButtonBase">
                                <Grid Name="Grid">
                                    <Grid.RenderTransform>
                                        <CompositeTransform TranslateX="0" TranslateY="0" ScaleX="1" ScaleY="1"/>
                                    </Grid.RenderTransform>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal">
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.ScaleY)" To="1" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.ScaleX)" To="1" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.TranslateX)" To="0" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.TranslateY)" To="0" Duration="0:0:0.1"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.ScaleY)" To="1.5" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.ScaleX)" To="1.5" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.TranslateX)" To="-12" Duration="0:0:0.1"/>
                                                    <DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="(Grid.RenderTransform).(CompositeTransform.TranslateY)" To="-16" Duration="0:0:0.1"/>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Border x:Name="Border" CornerRadius="6" BorderBrush="#22990033" BorderThickness="1">
                                    </Border>
                                    <ContentPresenter
                                        Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                       >

                                    </ContentPresenter>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style.Setters>

            </Style>

        </Grid.Resources>
        <Border CornerRadius="12,12,0,0" BorderThickness="1">
            <Border.Background>
                <LinearGradientBrush>
                    <GradientStop Offset="0" Color="#33333399"/>
                    <GradientStop Offset="1" Color="#11333333"/>
                </LinearGradientBrush>
            </Border.Background>
            <ContentPresenter Name="MenuBorder"></ContentPresenter>
        </Border>
    </Grid>
</UserControl>
